import UIKit

class MyClass {
    class func classMethod() {
        print("classMethod in MyClass")
    }
    
    static func staticMethod() {
        print("staticMethod in MyClass")
    }
}

class MySubClass: MyClass {
    override class func classMethod() {
        print("classMethod in MySubClass")
    }
    
    // 这里会报错，因为静态方法不能被覆盖
//     override static func staticMethod() { }
}
MyClass.classMethod() // 输出 "classMethod in MyClass"
MyClass.staticMethod() // 输出 "staticMethod in MyClass"

MySubClass.classMethod() // 输出 "classMethod in MySubClass"
MySubClass.staticMethod() // 输出 "staticMethod in MyClass"

struct MyStruct {
    static func staticMethod() {
        print("staticMethod in MyStruct")
    }
}

enum MyEnum {
    static func staticMethod() {
        print("staticMethod in MyEnum")
    }
}

MyStruct.staticMethod() // 输出 "staticMethod in MyStruct"
MyEnum.staticMethod() // 输出 "staticMethod in MyEnum"

let numbers = [1, 2, 3, 4, 5]
let array = numbers.split(whereSeparator: { $0 > 3 || $0 < 2 } )
print(array) // 输出: [ArraySlice([2, 3])]

let res = numbers.split { p in
    p > 3 || p < 2
}
print(res)
print("test")
//作者：杂雾无尘
//链接：https://zhuanlan.zhihu.com/p/671990530
//来源：知乎
//著作权归作者所有。商业转载请联系作者获得授权，非商业转载请注明出处。
